var mapIds = [993173000];
var 准备地图 = 993173150;

function init() {}

function setup(c, a) {
    em.setProperty("state", 1);
    em.setProperty("leader", "true");
    var c = em.newInstance("荣耀活动_海岸峭壁之战_支援基地");
    for (var b = 0; b < mapIds.length; b++) {
        var d = c.setInstanceMap(mapIds[b]);
        d.resetFully();
        d.spawnMonsterOnGroundBelow(em.getMonster(9833652), new java.awt.Point(358, -545))
    }
    c.schedule("刷怪", 2 * 1000);
    return c
}

function 刷怪(a) {
    a.schedule("刷怪", 2 * 1000);
    var b = a.getMapInstance(0);
    if (b.countMonsterById(9833651) >= 10) {
        b.killMonster(9833651, false, true);
        return
    }
    switch (a.rand(1, 10)) {
        case 1:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(-1331, -599));
            break;
        case 2:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(960, 163));
            break;
        case 3:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(-155, 163));
            break;
        case 4:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(-1331, -1070));
            break;
        case 5:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(1933, -896));
            break;
        case 6:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(1933, -1070));
            break;
        case 7:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(-600, 163));
            break;
        case 8:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(-1331, -896));
            break;
        case 9:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(1933, -598));
            break;
        case 10:
            b.spawnMonsterOnGroundBelow(em.getMonster(9833651), new java.awt.Point(1450, 163));
            break
    }
}

function onPlayerRegistered(b, a) {
    a.setReviveCount(-100);
    var c = b.getMapInstance(0);
    a.changeMap(c, c.getPortal(0))
}

function onPlayerRevived(b, a) {
    return false
}

function onMapChanged(c, b, a) {
    em.setProperty("kill", "0");
    em.setProperty("level", "0");
    em.setProperty("clear", "0");
    em.setProperty("curMap", a);
    if (mapIds.indexOf(a) < 0) {
        on玩家退场(c, b, false);
        return
    }
}

function onPlayerDisconnected(b, a) {
    on玩家退场(b, a, false);
    return 0
}

function onMonsterDamaged(b, a, d, e, c) {}

function onTimeOut(a) {
    a.getPlayers().forEach(function (b) {
        on玩家退场(a, b, true)
    })
}

function onMonsterKilled(b, d, c) {
    var a = em.getNumberProperty("kill") + 1;
    em.setProperty("kill", a)
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}
var setupTask;

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
}

function initProp(a, b) {
    if (em.getProperty(a) == null) {
        em.setProperty(a, b)
    }
}

function initPropArray(a, d, c, e) {
    for (var b = c; b <= e; b++) {
        if (em.getProperty(a + "_" + b) == null) {
            em.setProperty(a + "_" + b, d)
        }
    }
}

function on玩家退场(c, b, a) {
    b.getAPI().gloryMagicMudmanUI(0, 3, 0);
    b.getAPI().gloryMagicMudmanUI(0, 4, 0);
    c.disposeIfPlayerBelow(a ? 999 : 0, 准备地图);
    em.getProperties().clear();
    em.setProperty("state", 0);
    em.setProperty("leader", "true");
    c.unregisterPlayer(b)
}

function onItemPickedUp(b, a, c) {};